<?php

namespace App\Http\Resources;

use App\Models\Nft;
use Illuminate\Http\Request;
use Illuminate\Http\Resources\Json\JsonResource;

class MintResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @return array<string, mixed>
     */
    public function toArray(Request $request): array
    {
        $nft = Nft::where('nft_id',$this->nft_id)->first();
        return [
            'id' => $this->id,
            'nft_name' => $nft->name,
            'power' => $this->power,
            'per_mint' => $this->per_mint,
            'amount' => $this->amount,
            'hash' => $this->hash,
            'created_at' => $this->created_at,
        ];
    }
}
